package Thread;

class MyThread extends Thread{
    @Override
    public void run(){
        //这里写的代码，就是即将创建出的线程，要执行的逻辑
        while (true){
            System.out.println("hello thread");
        }
    }
}

public class Demo1 {
    public static void main(String[] args) {
        //创建线程
        MyThread th = new MyThread();

        //运行线程
        th.start();
        while (true){
            System.out.println("hello main");
        }
    }
}
